

import socket


clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

clientSocket.connect(('127.0.0.1', 8888))

while True:
    sendData = input("请输入要发送的数据:")
    clientSocket.send(sendData.encode("utf-8"))

    returnData = clientSocket.recv(1024)

    print("返回消息: ", returnData.decode("utf-8"))


